﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="listthay.ascx.cs" Inherits="UserControl_HocVien_WebUserControl" %>
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" 
    DataKeyNames="id" DataSourceID="SqlDataSource1" EnableModelValidation="True" OnRowDataBound="GridView1_RowDataBound">
    <Columns>
        <asp:BoundField DataField="id" HeaderText="id" InsertVisible="False" 
            ReadOnly="True" SortExpression="id" />
        <asp:BoundField DataField="HoTen" HeaderText="Họ Tên" SortExpression="HoTen" />
        <asp:BoundField DataField="GioiTinh" HeaderText="Giới Tính" 
            SortExpression="GioiTinh" />
        <asp:BoundField DataField="NgaySinh" HeaderText="Ngày Sinh" 
            SortExpression="NgaySinh" />
        <asp:BoundField DataField="QuocTich" HeaderText="Quốc Tịch" 
            SortExpression="QuocTich" />
        <asp:BoundField DataField="DienThoai1" HeaderText="Điện thoại 1" 
            SortExpression="DienThoai1" />
        <asp:BoundField DataField="DienThoai2" HeaderText="Điện thoại 2" 
            SortExpression="DienThoai2" />
        <asp:BoundField DataField="Email1" HeaderText="Email1" 
            SortExpression="Email1" />
        <asp:BoundField DataField="Email2" HeaderText="Email2" 
            SortExpression="Email2" />
        <asp:BoundField DataField="Skype" HeaderText="Skype" SortExpression="Skype" />
        <asp:BoundField DataField="NoiO" HeaderText="NoiO" SortExpression="NoiO" />
        <asp:BoundField DataField="Nguon" HeaderText="Nguon" SortExpression="Nguon" />
        <asp:BoundField DataField="Level" HeaderText="Level" SortExpression="Level" />
        <asp:BoundField DataField="NgayNhap" HeaderText="Ngày nhập" 
            SortExpression="NgayNhap" />
        <asp:TemplateField HeaderText="Chức năng" HeaderStyle-HorizontalAlign="Center" 
                                                ItemStyle-HorizontalAlign="Center"
                                                ItemStyle-Width="8%">
            <ItemTemplate>
                <asp:HyperLink ID="hplAddThay" CssClass="cssHyperLinkIcon" Target="_blank" runat="server"
                    ImageUrl="~/images/Button/Insert.gif" ToolTip="Thêm sự kiện" />
                <asp:HyperLink ID="hplUpdateThay" CssClass="cssHyperLinkIcon" Target="_blank"
                    runat="server"
                    ImageUrl="~/images/Button/Edit.gif" ToolTip="Sửa bản ghi" />
                <% if (Convert.ToBoolean(Session["QuyenUser"]) == true)
                { %>
                    <asp:ImageButton ID="btnDelete" AccessKey="d"  runat="server" ImageUrl="~/images/Button/Delete.gif"
                            ToolTip="Xóa bản ghi" CommandName="delete" 
                            OnClientClick = "javascript:if(confirm('Bạn chắc chắn muốn xóa OK , Bạn hủy lệnh CANCEL')) {return true} else {return false};" />
                <%} %>
            </ItemTemplate>
         </asp:TemplateField>
    </Columns>
</asp:GridView>
<asp:SqlDataSource ID="SqlDataSource1" runat="server" 
    ConnectionString="<%$ ConnectionStrings:CRM_TUYEN_THAYConnectionString %>" 
    SelectCommand="SELECT * FROM [TB_contact]"></asp:SqlDataSource>

